﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace MVC.Models {
  public class Student {
    //[Key]
    //[ScaffoldColumn(false)]
    //[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int Id { get; set; }
    [Display(Name="姓名")]
    [Required(ErrorMessage ="姓名不能为空")]
    [MaxLength(50,ErrorMessage ="姓名长度不能超过50")]
    public string Name { get; set; }
    [Display(Name="班级信息")]
    [Required(ErrorMessage ="请选择班级信息")]
    public ClassNameEnum? ClassName { get; set; }
    [Required(ErrorMessage ="邮箱不能为空")]
    [Display(Name="邮箱")]
    [RegularExpression("^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$")]
    public string Email { get; set; }
    public string AvatarPath { get; set; }

  }
}
